home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
-
- /*
- * Visible definitions
- */
- #ifndef FALSE
- #define FALSE 0
- #endif
-
- #ifndef TRUE
- #define TRUE 1
- #endif
-
- #define AWK_INDEX 0
- #define AWK_INT 1
- #define AWK_FLOAT 2
- #define AWK_STRING 3
- #define AWK_POINTER 4
-
- /*
- * Visible structure definitions
- */
- typedef struct {
- int max; /* maximum number of elements in the array */
- int remain; /* remaining locations in the array */
- int index; /* index used by nextkey() command */
- char *name; /* the name of the array */
- char **key; /* pointer to a list of key strings, 1 per element */
- int *ival; /* pointer to a list of int value, int arrays only */
- float *fval; /* pointer to a list of float values, float only */
- char **string; /* pointer to a list of strings, string arrays only */
- int access; /* count number of accesses of the array */
- int search; /* count number 'index bumps' during accesses */
- } AwkArray;
-
- /*
- * Visible global variable definitions
- */
- extern int awkNF;
- extern int awkNL;
- extern int awkNR;
- extern int awkFS;
- extern int awkRS;
- extern char awkFILENAME[];
- extern char *awkARG[];
-
- /*
- * Visible procedure and function definitions
- */
- void awkAddFloat (AwkArray *array, char *key, float f);
- int awkAddIndex (register AwkArray *array, register char *key);
- void awkAddInt (AwkArray *array, char *key, int i);
- void awkAddPointer (AwkArray *array, char *key, void *p);
- void awkAddString (AwkArray *array, char *key, char *s);
- AwkArray* awkNewArray (char *name, int type);
- void awkExit (void);
- void awkFile (char *name);
- void awkInit (int argc, char **argv);
- int awkStrSame (register char *s1, register char *s2);
- void awkFirstKey (AwkArray *array);
- float awkGetFloat (AwkArray *array, char *key);
- int awkGetIndex (register AwkArray *array, register char *key);
- int awkGetInt (AwkArray *array, char *key);
- void* awkGetPointer (AwkArray *array, char *key);
- void awkGetString (AwkArray *array, char *key, char *s);
- int awkNextKey (AwkArray *array, char *key);
- int awkNextRecord (void);
- int awkStrIndex (register char *s1, register char *s2);
- void awkSubStr(register char *s1, register char *s2, register m, register n);
-